from Mr_Zhong.utils.train import*

# 0.1交叉网格划分
param_dict = {
    'n_estimators': [i for i in range(10, 500, 10)],
    'max_depth': [i for i in range(2, 13, 1)],
    'learning_rate': [0.01, 0.1]
}
# 0.2超参数输入
n_estimators = 125
max_depth = 2
learning_rate = 0.1

# 1.加载数据集
input_file = os.path.join('../data', 'train.csv')
model = PowerLoadModel(input_file)
# # 2.分析数据
# ana_data(model.data_source)
# 3.特征工程
X_train, Y_train = feature_engineering(model.data_source, model.logfile)

# 4.交叉网格化选取最优参数
# model_CV_train(X_train, Y_train, model.logfile, param_dict)

# # 5.模型训练、模型评价与模型保存
model_train(X_train, Y_train, model.logfile, n_estimators, max_depth, learning_rate)